goog.provide('dkpoints.nav.Handler');

/**
 * @fileoverview
 * dkpoints.nav.Handler is an interface which all handlers need to implement.
 * Note: Since Handler implements no actual logic, there is no test suite
 * for it.
 */



/**
 * The interface for a navigation handler object.
 * @param {dkpoints.ServiceProvider} serviceProvider The provider instance for
 *    the app's subsystems.
 * @interface
 */
dkpoints.nav.Handler = goog.abstractMethod;


/**
 * Handler constructor functions need to have a requiredAuth property.
 * @type {dkpoints.auth.AuthState}
 * @const
 */
dkpoints.nav.Handler.requiredAuth;


/**
 * The call to action for a navigation handler.
 * @param {dkpoints.nav.Path} path An object with request-specific parameters.
 */
dkpoints.nav.Handler.prototype.handle = goog.abstractMethod;


/**
 * When the handler instance is already active, transition will be called on
 * new navigations instead of handle to allow the handler to more easily
 * transition set up the new state of the active driver instead of rebuilding
 * it from scratch.
 * @param {dkpoints.nav.Path} path An object with request-specific parameters.
 * @param {function()} onCancel Callback to be invoked if user decides
 *    not to navigate away from what they're doing.
 */
dkpoints.nav.Handler.prototype.transition = goog.abstractMethod;


/**
 * Save state and clear the user-interface so the next handler can use the
 * screen.
 * @param {function(boolean)} onExit Callback once exit is either
 *    complete or cancelled by the user.  Passing true to the callback means
 *    that the handler has relinquished control of thep age; false means
 *    the user opted not to navigate away.
 */
dkpoints.nav.Handler.prototype.exit = goog.abstractMethod;
